using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIContorl : MonoBehaviour
{
    public Text damageText;
    public float lifeSpeed;
    public float lifeTimer;
    private void OnEnable()
    {
        Destroy(gameObject, lifeTimer);
    }
    private void Update()
    {
        damageText.transform.position += new Vector3(0, lifeSpeed * Time.deltaTime, 0);
    }
    public void ShowUIDamage(float damage)
    {
        if (damage > 70)
        {
            damageText.text = "<color=#FF8E00><size=70>暴击</size> " + damage.ToString()+"</color>";
        }
        else
        {
            damageText.text = damage.ToString();
        }
        
    }
}
